//
//  SceneDeviceModel.m
//  wAudioShare
//
//  Created by Anson on 14-11-7.
//  Copyright (c) 2014年 赵帅. All rights reserved.
//

#import "SceneDeviceModel.h"

@implementation SceneDeviceModel

+ (SceneDeviceType)getTypeFromVal:(NSInteger)val {
    
    SceneDeviceType type = SceneDeviceTypeInvalid;
    switch (val) {
        case 1:
            type = SceneDeviceTypeSwitch;
            break;
        
        case 2:
            type = SceneDeviceTypeDimmer;
            break;
            
        case 5:
            type = SceneDeviceTypePowerMeter;
            break;
            
        case 6:
            type = SceneDeviceTypeThermostat;
            break;
            
        case 8:
            type = SceneDeviceTypeMotor;
            break;
            
        case 60001:
            type = SceneDeviceTypeThermostatMode;
            break;
            
        case 60002:
            type = SceneDeviceTypeThermostatTemperature;
            break;
            
        default:
            break;
    }
    return type;
}

- (id)copyWithZone:(NSZone *)zone {
    
    SceneDeviceModel *copy = [[[self class] allocWithZone: zone] init];
    
    copy.deviceId = self.deviceId;
    copy.deviceType = self.deviceType;
    copy.title = self.title;
    copy.isOn = self.isOn;
    copy.percent = self.percent;
    copy.mode = self.mode;
    copy.thermostatTemperature = self.thermostatTemperature;
    return copy;
    
}

@end
